home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / perl5 / Text::Wrap.z / Text::Wrap
Encoding:
Text File  |  2002-10-03  |  2.2 KB  |  67 lines

  1.  
  2.  
  3.  
  4. TTTTeeeexxxxtttt::::::::WWWWrrrraaaapppp((((3333))))                                                    TTTTeeeexxxxtttt::::::::WWWWrrrraaaapppp((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Text::Wrap - line wrapping to form simple paragraphs
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.              use Text::Wrap
  13.  
  14.              print wrap($initial_tab, $subsequent_tab, @text);
  15.              print fill($initial_tab, $subsequent_tab, @text);
  16.  
  17.              use Text::Wrap qw(wrap $columns $huge);
  18.  
  19.              $columns = 132;
  20.              $huge = 'die';
  21.              $huge = 'wrap';
  22.  
  23.  
  24. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  25.      _T_e_x_t::_W_r_a_p::_w_r_a_p() is a very simple paragraph formatter.  It formats a
  26.      single paragraph at a time by breaking lines at word boundaries.
  27.      Indentation is controlled for the first line ($initial_tab) and all
  28.      subsequent lines ($subsequent_tab) independently.
  29.  
  30.      Lines are wrapped at $Text::Wrap::columns columns. $Text::Wrap::columns
  31.      should be set to the full width of your output device.
  32.  
  33.      When words that are longer than $columns are encountered, they are broken
  34.      up.  Previous versions of _w_r_a_p() _d_i_e()ed instead.  To restore the old
  35.      (dying) behavior, set $Text::Wrap::huge to 'die'.
  36.  
  37.      _T_e_x_t::_W_r_a_p::_f_i_l_l() is a simple multi-paragraph formatter.  It formats
  38.      each paragraph separately and then joins them together when it's done.
  39.      It will destroy any whitespace in the original text.  It breaks text into
  40.      paragraphs by looking for whitespace after a newline.  In other respects
  41.      it acts like _w_r_a_p().
  42.  
  43. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  44.              print wrap("\t","","This is a bit of text that forms
  45.                      a normal book-style paragraph");
  46.  
  47.  
  48. AAAAUUUUTTTTHHHHOOOORRRR
  49.      David Muir Sharnoff <muir@idiom.com> with help from Tim Pierce and many
  50.      many others.
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.